public class Test1 {
    public static void main(String[] args) {


        Student s = new Student();
        s.setName("学生");
        s.setAge(10);


        Teacher t = new Teacher();
        t.setName("老师");
        t.setAge(20);


        Person p = new Student();
        p.setName("人");
        p.setAge(88);


        Person p1 = new Teacher();
        p1.setName("人");
        p1.setAge(88);


        register(s);
        register(t);
        register(p);
        register(p1);

    }

    public static void register(Person m) {
        m.show();
    }


}
